<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>2-2-条件渲染-组合式</title>
</head>

<body>


    <!--载入vue.js-->
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>


    <div id="Application">
        <!--分数查询-->
        <input v-model="achievement" type="text">
        <button @click="query">真/假</button>

        <div v-if="show">
            <h1 v-if="achievement == 100">满分</h1>
            <h1 v-else-if="achievement > 60">及格</h1>
            <h1 v-else>不及格</h1>
        </div>
    </div>
    <script>
        const app = Vue.createApp({
            setup() {
                const show = Vue.ref(false);
                const achievement = Vue.ref()

                const query = () => {
                    if (show.value) {
                        show.value = false
                    } else {
                        show.value = true
                    }
                };
                return {
                    show,
                    achievement,
                    query,
                }
            }
        })
        app.mount("#Application")

    </script>

    <style>

    </style>


</body>

</html>